.libPaths("/home/m081429/R/x86_64-unknown-linux-gnu-library/2.15")
 source("http://bioconductor.org/biocLite.R")
    biocLite("CNTools")
library(CNTools)
data("sampleData")
ls()
dim(sampleData)
is.dataframe(sampleData)
is.data.frame(sampleData)
sampleData[1,]
table(sampleData[,1])
sampleData[1,]
getwd()
setwd("/data4/bsi/bioinf_ext1/s113861.chrX/TCGA_DATA/CNV")
sampleData<-read.table("selected.txt",sep="\t",head=T)
seg <- CNSeg(sampleData[which(is.element(sampleData[, "ID"],
sample(unique(sampleData[, "ID"]), 10))), ])
rsBypair <- getRS(seg, by = "pair", imput = FALSE, XY = FALSE, what = "mean")
dim(seg)
sampleData[1,]
rdseg <- getRS(seg, by = "region", imput = FALSE, XY = FALSE, what = "mean")
?getRS
dim(rdseg)
is.object(rdseg)
names(rdseg)
attributes(rdseg)
data("geneInfo")\
data("geneInfo")
geneInfo[1,]
dim(geneInfo)
geneInfo <- geneInfo[sample(1:nrow(geneInfo), 2000), ]
rdByGene <- getRS(cnseg, by = "gene", imput = FALSE, XY = FALSE, geneMap = geneInfo)
rdByGene <- getRS(seg, by = "gene", imput = FALSE, XY = FALSE, geneMap = geneInfo)
rdByGene <- getRS(seg, by = "gene", imput = FALSE, XY = FALSE, geneMap = geneInfo,what = "mean")
reducedseg <- rs(rdseg)
dim(reducedseg)
reducedseg[1,]
savehistory("script_cnv.R")
getwd()
library(CNTools)
setwd("/data4/bsi/bioinf_ext1/s113861.chrX/TCGA_DATA/CNV")
sampleData<-read.table("selected.txt",sep="\t",head=T)
sampleData[1, "ID"]
sampleData[1, ]
savehistory("script_cnv_del.R")
